<template>
    <div>
        <ul class="gs01">
            <li v-for="ls in list" :key="ls.id">
                <router-link :to="{path: url,query:{type:ls.type,id:ls.id}}">
                    <span>{{ ls.title }}</span>
                    <img src="../../assets/images/fh03.png" alt="">
                </router-link>
                <p>
                    <img src="../../assets/images/eye.png" alt="">
                    <span>{{ ls.count }}</span>次
                </p>
            </li>
        </ul>
    </div>
</template>

<script>
    import home from '@/api/tap-water/home';

    export default {
        name: "list",
        data() {
            return {
                list: [],
                url: this.$route.query.url,
                type: this.$route.query.type
            }
        },
        created() {
            this.getListByType(this.type);
        },
        methods: {
            getListByType(type) {
                home.getListByType(type).then(res => {
                    this.list = res.data.data;
                })
            },
        }
    }
</script>

<style scoped>
    @import "../../assets/tap-water/css/base.css";
    @import "../../assets/tap-water/css/other.css";
</style>